getRetainInstance

Deprecated

Instead of retaining the Fragment itself, use a non-retained Fragment and keep retained state in a ViewModel attached to that Fragment. The ViewModel's constructor and its onCleared() callback provide the signal for initial creation and final destruction of the retained state.

Returns true if this fragment instance's state will be retained across configuration changes, and false if it will not.

Return

whether or not this fragment instance will be retained.

See also